home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-24 | 27.0 KB | 2,097 lines |
- =======================================
- Short instruction for pasm beta version
- =======================================
-
- pasm can currently generate either ELF objects or absolute files.
-
- All PowerPC standard instructions are supported: User level-, super-
- visor level-, optional-, 32-bit and 64-bit instructions.
-
- All 32-bit extended mnemonics are supported and most of the 64-bit
- extended mnemonics.
-
-
-
- DIRECTIVES
- ==========
-
-
- .ascii <exp1>[,<exp2>,"<string1>"...]
- ----------------------------------
- See ".byte".
-
-
- .asciiz "<string1>"[,"<string2>"...]
- ------------------------------------
- See ".string".
-
-
- .align <bit_count>
- ------------------
- Insert as much zero bytes as required to reach an address where
- <bit_count> low order bits are zero. For example ".align 2" would
- make an alignment to the next 32-bit boundary.
-
-
- .baserel <section>,<base_reg>
- -----------------------------
- Allow base relative access via register <base_reg> in the section
- called <section>. In absolute mode, <base_reg> must be initialized
- with an address pointing 32764 bytes behind the start address of
- this section. In EHF, <base_reg> must be initialized with the linker
- symbol _LinkerDB. In ELF/SystemV ABI small data or TOC addressing
- is not supported. (?)
-
- By default, base relative access via r2 (rtoc) on the section
- ".tocd" is set.
-
-
- .bss <symbol>,<size>[,<alignment>]
- ----------------------------------
- Allocate <size> bytes of space in the .bss section and assign
- the value to that location to <symbol>. If <alignment> is given,
- then the space will be aligned to an address having <alignment>
- low zero bits or 2, whichever is greater.
- <symbol> may be made globally visible by the .globl directive.
-
-
- .byte <exp1>[,<exp2>,"<string1>"...]
- ------------------------------------
- Assign the integer or string constant operands into successive
- bytes of memory in the current section. Any combination of integer
- and character string constant operands is permitted.
-
-
- .comm <symbol>,<size>
- ---------------------
- Allocate <size> bytes of space in the .bss section and assign
- the value to that location to <symbol>. <symbol> is always made
- globally visible. ".comm"-areas of less than 8 bytes in size are
- aligned to word boundaries, otherwise to doubleword boundaries.
-
-
- .double <float1>[,<float2>...]
- ------------------------------
- If the current section location counter is not on a doubleword
- boundary advance it to the next doubleword boundary. Then assign
- the values of the operands as IEEE 754 double-precision 64-bit
- format numbers to successive doublewords of memory in the current
- section.
-
-
- .else
- -----
- Begins the "else"-part in a block of conditional assembly.
-
-
- .endif
- ------
- Ends a block of conditional assembly.
-
-
- .endm
- -----
- Ends a macro definition.
-
-
- .extern <symbol>
- ----------------
- See ".globl".
-
-
- .fail
- -----
- Abort assembly with displaying the error message "fail directive
- encountered".
-
-
- .file "<file name>"
- -------------------
- Specify the source file name, which is included into the object
- file as a symbol of type "FILE" with local binding.
-
-
- .float <float1>[,<float2>...]
- -----------------------------
- If the current section location counter is not on a word boundary
- advance it to the next word boundary. Then assign the values of the
- operands as IEEE 754 single precision 32-bit format numbers to
- successive words of memory in the current section.
-
-
- .global <symbol>
- ----------------
- See ".globl".
-
-
- .globl <symbol>
- ---------------
- Flag <symbol> as an external symbol, which means that <symbol> is
- visible to all modules in the linking process. It may be either
- defined or undefined.
-
-
- .half <exp1>[,<exp2>...]
- ------------------------
- If the current section location counter is not on a halfword
- boundary, advance it to the next halfword boundary. Then, assign
- the values of the operands into successive halfwords of memory in
- the current section.
-
-
- .ident "<string>"
- -----------------
- Place an indentification string into the .comment section (ELF)
- or use it as object unit title (EHF).
-
-
- .if<cond> <exp>
- ---------------
- The following block will only be assembled, if the condition <cond>
- is valid for the expression <exp>. Available conditions are:
- .if assemble, if <exp> is not zero.
- .ifeq assemble, if <exp> is zero.
- .ifne assemble, if <exp> is not zero.
- .ifgt assemble, if <exp> is greater than zero.
- .ifge assemble, if <exp> is greater than zero or equal (positive).
- .iflt assemble, if <exp> is less than zero (negative).
- .ifle assemble, if <exp> is less than zero or equal.
- .ifdef assemble, if <exp> is defined.
- .ifndef assemble, if <exp> is undefined.
-
- A block of conditional assembly is ended by ".endif". A maximum of
- eight if-levels is allowed.
-
-
- .include <file name>
- --------------------
- Includes another source text. Besides the current directory, all
- include paths, defined by the -I option, are searched.
-
-
- .lcomm <symbol>,<size>[,<alignment>]
- ------------------------------------
- See ".bss".
-
-
- .local <symbol>
- ---------------
- Explicitely declare symbol to have local binding. It is not
- visible outside the object file containing its definition.
- <symbol> must be known (ELF only).
-
-
- .long <exp1>[,<exp2>...]
- ------------------------
- See ".word".
-
-
- .macro <name>
- -------------
- Define a new macro, called <name>. Macro parameters can be acces-
- sed by \1 to \9. \0 is reserved for the branch hint. Example:
-
- .macro bdz
- bc\0 18,0,\1
- .endm
-
- \@ will be replaced by a unique number on every macro invocation
- and should be used when defining labels in a macro.
-
-
- .newsection <name>[,"<attributes>"]
- -----------------------------------
- This directives differs from the normal .section directive in the
- case if a section called <name> already exists. .newsection will
- then force the start of a new section with the same name and
- effectively ends any further definition for the earlier section.
- For the rest, see ".section".
-
-
- .section <name>[,"<attributes>"]
- --------------------------------
- Starts a new section named <name> or reactivate an old one. If
- attributes are given for an already existing section, they must
- match exactly. The section's name will also be defined as a new
- symbol, which represents the section's start address.
-
- The "<attributes>" string may consist of the following characters:
-
- Section Contents:
- c - section has code
- d - section has initialized data
- u - section has uninitialized data
- i - section has directives (info section)
- n - section can be discarded
- R - remove section at link time
-
- Section Protection:
- r - section is readable
- w - section is writable
- x - section is executable
- s - section is sharable
-
- Section Alignment (only one):
- 0 - align to byte boundary
- 1 - align to halfword boundary
- 2 - align to word boundary
- 3 - align to doubleword boundary
- 4 - align to quadword boundary
- 5 - align to 32 byte boundary
- 6 - align to 64 byte boundary
-
-
- .set <symbol>,<expression>
- --------------------------
- Create a new program symbol with the name <symbol> and assign to it
- the value of <expression>. If <symbol> is already assigned, it will
- contain a new value from now on. If <expression> is undefined in
- pass 1 (because symbols in it are defined some lines later) it will
- get a default value of '1', which is changed in pass 2 to the
- correct value. So it is visible for .ifdef, etc.
-
-
- .size <symbol>,<size>
- ---------------------
- Set the size in bytes of an object defined at <symbol>.
-
-
- .short <exp1>[,<exp2>...]
- -------------------------
- See ".half".
-
-
- .space <exp>
- ------------
- Insert <exp> zero bytes into the current section.
-
-
- .string "<string1>"[,"<string2>"...]
- ------------------------------------
- Assign the characters in each string along with a final zero byte
- to successive memory locations in the current section.
-
-
- .type <symbol>,<type>
- ---------------------
- Set type of symbol called <symbol> to <type>, which must be one of:
- 1: Object
- 2: Function
- 3: Section
- 4: File
-
- The predefined symbols @object and @function are available for
- this purpose.
-
-
- .uadouble <float1>[,<float2>...]
- --------------------------------
- Assign the values of the operands as IEEE 754 double-precision 64-
- bit format numbers to successive eight-byte areas of memory in the
- current section regardless of section alignment.
-
-
- .uafloat <float1>[,<float2>...]
- -------------------------------
- Assign the values of the operands as IEEE 754 single precision 32-
- bit format numbers to successive 4-byte areas of memory in the
- current section regardless of section alignment.
-
-
- .uahalf <exp1>[,<exp2>...]
- --------------------------
- Assign the values of the operands into successive two byte areas of
- memory in the current section regardless of section alignment.
-
-
- .ualong <exp1>[,<exp2>...]
- --------------------------
- See ".uaword".
-
-
- .uashort <exp1>[,<exp2>...]
- ---------------------------
- See ".uahalf".
-
-
- .uaword <exp1>[,<exp2>...]
- --------------------------
- Assign the values of the operands into successive four-byte areas
- of memory in the current section regardless of section alignment.
-
-
- .word <exp1>[,<exp2>...]
- ------------------------
- If the current section location counter is not on a word boundary
- advance it to the next word boundary. Then assign the values of the
- operands into successive words of memory in the current section.
-
-
-
- PREDEFINED SYMBOLS
- ==================
-
- There are two symbols, which are always updated by the assembler.
-
- $ Current address counter value.
-
- $NARG Number of macro arguments during macro execution.
- It is zero, when outside of a macro.
-
- The following symbols are constant and may be deactivated by
- specifying the -R option.
-
- .set r0,0
- .set r1,1
- .set r2,2
- .set r3,3
- .set r4,4
- .set r5,5
- .set r6,6
- .set r7,7
- .set r8,8
- .set r9,9
- .set r10,10
- .set r11,11
- .set r12,12
- .set r13,13
- .set r14,14
- .set r15,15
- .set r16,16
- .set r17,17
- .set r18,18
- .set r19,19
- .set r20,20
- .set r21,21
- .set r22,22
- .set r23,23
- .set r24,24
- .set r25,25
- .set r26,26
- .set r27,27
- .set r28,28
- .set r29,29
- .set r30,30
- .set r31,31
- .set f0,0
- .set f1,1
- .set f2,2
- .set f3,3
- .set f4,4
- .set f5,5
- .set f6,6
- .set f7,7
- .set f8,8
- .set f9,9
- .set f10,10
- .set f11,11
- .set f12,12
- .set f13,13
- .set f14,14
- .set f15,15
- .set f16,16
- .set f17,17
- .set f18,18
- .set f19,19
- .set f20,20
- .set f21,21
- .set f22,22
- .set f23,23
- .set f24,24
- .set f25,25
- .set f26,26
- .set f27,27
- .set f28,28
- .set f29,29
- .set f30,30
- .set f31,31
- .set cr0,0
- .set cr1,1
- .set cr2,2
- .set cr3,3
- .set cr4,4
- .set cr5,5
- .set cr6,6
- .set cr7,7
- .set lt,0
- .set gt,1
- .set eq,2
- .set so,3
- .set un,3
- .set sp,1
- .set rtoc,2
- .set fp,31
- .set fpscr,0
- .set xer,1
- .set lr,8
- .set ctr,9
-
-
-
- PREDEFINED SECTIONS
- ===================
- .section .text,"crx3"
- .section .data,"drw3"
- .section .bss,"urw3"
- .section .rodata,"dr3"
- .section .tocd,"drw3"
-
-
-
- EXTENDED MNEMONICS
- ==================
-
- There is a huge set of extended mnemonics, proposed by Motorola
- and IBM in the "PowerPC Programming Environments", to make the
- programmer's life easier. Except for some 64-bit mnemonics (I only
- downloaded the 32-bit manuals for now), pasm supports them all.
-
- Currently all extended mnemonics (except "la") are implemented
- as macros and can be deactivated with the -X option.
-
-
- List of extended mnemonics
- --------------------------
- .macro subi
- addi \1,\2,-(\3)
- .endm
-
- .macro subis
- addis \1,\2,-(\3)
- .endm
-
- .macro subic
- addic \1,\2,-(\3)
- .endm
-
- .macro subic.
- addic. \1,\2,-(\3)
- .endm
-
- .macro sub
- subf \1,\3,\2
- .endm
-
- .macro sub.
- subf. \1,\3,\2
- .endm
-
- .macro subo
- subfo \1,\3,\2
- .endm
-
- .macro subo.
- subfo. \1,\3,\2
- .endm
-
- .macro subc
- subfc \1,\3,\2
- .endm
-
- .macro subc.
- subfc. \1,\3,\2
- .endm
-
- .macro subco
- subfco \1,\3,\2
- .endm
-
- .macro subco.
- subfco. \1,\3,\2
- .endm
-
- .macro cmpwi
- .ifeq $NARG-2
- cmpi 0,0,\1,\2
- .else
- cmpi \1,0,\2,\3
- .endif
- .endm
-
- .macro cmpw
- .ifeq $NARG-2
- cmp 0,0,\1,\2
- .else
- cmp \1,0,\2,\3
- .endif
- .endm
-
- .macro cmplwi
- .ifeq $NARG-2
- cmpli 0,0,\1,\2
- .else
- cmpli \1,0,\2,\3
- .endif
- .endm
-
- .macro cmplw
- .ifeq $NARG-2
- cmpl 0,0,\1,\2
- .else
- cmpl \1,0,\2,\3
- .endif
- .endm
-
- .macro cmpdi
- .ifeq $NARG-2
- cmpi 0,1,\1,\2
- .else
- cmpi \1,1,\2,\3
- .endif
- .endm
-
- .macro cmpd
- .ifeq $NARG-2
- cmp 0,1,\1,\2
- .else
- cmp \1,1,\2,\3
- .endif
- .endm
-
- .macro cmpldi
- .ifeq $NARG-2
- cmpli 0,1,\1,\2
- .else
- cmpli \1,1,\2,\3
- .endif
- .endm
-
- .macro cmpld
- .ifeq $NARG-2
- cmpl 0,1,\1,\2
- .else
- cmpl \1,1,\2,\3
- .endif
- .endm
-
-
- .macro extlwi
- rlwinm \1,\2,\4,0,(\3)-1
- .endm
-
- .macro extlwi.
- rlwinm. \1,\2,\4,0,(\3)-1
- .endm
-
- .macro extrwi
- rlwinm \1,\2,(\4)+(\3),32-(\3),31
- .endm
-
- .macro extrwi.
- rlwinm. \1,\2,(\4)+(\3),32-(\3),31
- .endm
-
- .macro inslwi
- rlwimi \1,\2,32-(\4),\4,((\4)+(\3))-1
- .endm
-
- .macro inslwi.
- rlwimi. \1,\2,32-(\4),\4,((\4)+(\3))-1
- .endm
-
- .macro insrwi
- rlwimi \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
- .endm
-
- .macro insrwi.
- rlwimi. \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
- .endm
-
- .macro rotlwi
- rlwinm \1,\2,\3,0,31
- .endm
-
- .macro rotlwi.
- rlwinm. \1,\2,\3,0,31
- .endm
-
- .macro rotrwi
- rlwinm \1,\2,32-(\3),0,31
- .endm
-
- .macro rotrwi.
- rlwinm. \1,\2,32-(\3),0,31
- .endm
-
- .macro rotlw
- rlwnm \1,\2,\3,0,31
- .endm
-
- .macro rotlw.
- rlwnm. \1,\2,\3,0,31
- .endm
-
- .macro slwi
- rlwinm \1,\2,\3,0,31-(\3)
- .endm
-
- .macro slwi.
- rlwinm. \1,\2,\3,0,31-(\3)
- .endm
-
- .macro srwi
- rlwinm \1,\2,32-(\3),\3,31
- .endm
-
- .macro srwi.
- rlwinm. \1,\2,32-(\3),\3,31
- .endm
-
- .macro clrlwi
- rlwinm \1,\2,0,\3,31
- .endm
-
- .macro clrlwi.
- rlwinm. \1,\2,0,\3,31
- .endm
-
- .macro clrrwi
- rlwinm \1,\2,0,0,31-(\3)
- .endm
-
- .macro clrrwi.
- rlwinm. \1,\2,0,0,31-(\3)
- .endm
-
- .macro clrlslwi
- rlwinm \1,\2,\4,(\3)-(\4),31-(\4)
- .endm
-
- .macro clrlslwi.
- rlwinm. \1,\2,\4,(\3)-(\4),31-(\4)
- .endm
-
-
- .macro bt
- bc\0 12,\1,\2
- .endm
-
- .macro bf
- bc\0 4,\1,\2
- .endm
-
- .macro bdnz
- bc\0 16,0,\1
- .endm
-
- .macro bdnzt
- bc\0 8,\1,\2
- .endm
-
- .macro bdnzf
- bc\0 0,\1,\2
- .endm
-
- .macro bdz
- bc\0 18,0,\1
- .endm
-
- .macro bdzt
- bc\0 10,\1,\2
- .endm
-
- .macro bdzf
- bc\0 2,\1,\2
- .endm
-
- .macro bta
- bca\0 12,\1,\2
- .endm
-
- .macro bfa
- bca\0 4,\1,\2
- .endm
-
- .macro bdnza
- bca\0 16,0,\1
- .endm
-
- .macro bdnzta
- bca\0 8,\1,\2
- .endm
-
- .macro bdnzfa
- bca\0 0,\1,\2
- .endm
-
- .macro bdza
- bca\0 18,0,\1
- .endm
-
- .macro bdzta
- bca\0 10,\1,\2
- .endm
-
- .macro bdzfa
- bca\0 2,\1,\2
- .endm
-
- .macro blr
- bclr 20,0
- .endm
-
- .macro btlr
- bclr\0 12,\1
- .endm
-
- .macro bflr
- bclr\0 4,\1
- .endm
-
- .macro bdnzlr
- bclr\0 16,0
- .endm
-
- .macro bdnztlr
- bclr\0 8,\1
- .endm
-
- .macro bdnzflr
- bclr\0 0,\1
- .endm
-
- .macro bdzlr
- bclr\0 18,0
- .endm
-
- .macro bdztlr
- bclr\0 10,\1
- .endm
-
- .macro bdzflr
- bclr\0 2,\1
- .endm
-
- .macro bctr
- bcctr 20,0
- .endm
-
- .macro btctr
- bcctr\0 12,\1
- .endm
-
- .macro bfctr
- bcctr\0 4,\1
- .endm
-
- .macro btl
- bcl\0 12,\1,\2
- .endm
-
- .macro bfl
- bcl\0 4,\1,\2
- .endm
-
- .macro bdnzl
- bcl\0 16,0,\1
- .endm
-
- .macro bdnztl
- bcl\0 8,\1,\2
- .endm
-
- .macro bdnzfl
- bcl\0 0,\1,\2
- .endm
-
- .macro bdzl
- bcl\0 18,0,\1
- .endm
-
- .macro bdztl
- bcl\0 10,\1,\2
- .endm
-
- .macro bdzfl
- bcl\0 2,\1,\2
- .endm
-
- .macro btla
- bcla\0 12,\1,\2
- .endm
-
- .macro bfla
- bcla\0 4,\1,\2
- .endm
-
- .macro bdnzla
- bcla\0 16,0,\1
- .endm
-
- .macro bdnztla
- bcla\0 8,\1,\2
- .endm
-
- .macro bdnzfla
- bcla\0 0,\1,\2
- .endm
-
- .macro bdzla
- bcla\0 18,0,\1
- .endm
-
- .macro bdztla
- bcla\0 10,\1,\2
- .endm
-
- .macro bdzfla
- bcla\0 2,\1,\2
- .endm
-
- .macro blrl
- bclrl 20,0
- .endm
-
- .macro btlrl
- bclrl\0 12,\1
- .endm
-
- .macro bflrl
- bclrl\0 4,\1
- .endm
-
- .macro bdnzlrl
- bclrl\0 16,0
- .endm
-
- .macro bdnztlrl
- bclrl\0 8,\1
- .endm
-
- .macro bdnzflrl
- bclrl\0 0,\1
- .endm
-
- .macro bdzlrl
- bclrl\0 18,0
- .endm
-
- .macro bdztlrl
- bclrl\0 10,\1
- .endm
-
- .macro bdzflrl
- bclrl\0 2,\1
- .endm
-
- .macro bctrl
- bcctrl 20,0
- .endm
-
- .macro btctrl
- bcctrl\0 12,\1
- .endm
-
- .macro bfctrl
- bcctrl\0 4,\1
- .endm
-
-
- .macro blt
- .ifeq $NARG-1
- bc\0 12,0,\1
- .else
- bc\0 12,4*(\1)+0,\2
- .endif
- .endm
-
- .macro ble
- .ifeq $NARG-1
- bc\0 4,1,\1
- .else
- bc\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro beq
- .ifeq $NARG-1
- bc\0 12,2,\1
- .else
- bc\0 12,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bge
- .ifeq $NARG-1
- bc\0 4,0,\1
- .else
- bc\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bgt
- .ifeq $NARG-1
- bc\0 12,1,\1
- .else
- bc\0 12,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bnl
- .ifeq $NARG-1
- bc\0 4,0,\1
- .else
- bc\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bne
- .ifeq $NARG-1
- bc\0 4,2,\1
- .else
- bc\0 4,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bng
- .ifeq $NARG-1
- bc\0 4,1,\1
- .else
- bc\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bso
- .ifeq $NARG-1
- bc\0 12,3,\1
- .else
- bc\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bns
- .ifeq $NARG-1
- bc\0 4,3,\1
- .else
- bc\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bun
- .ifeq $NARG-1
- bc\0 12,3,\1
- .else
- bc\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnu
- .ifeq $NARG-1
- bc\0 4,3,\1
- .else
- bc\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro blta
- .ifeq $NARG-1
- bca\0 12,0,\1
- .else
- bca\0 12,4*(\1)+0,\2
- .endif
- .endm
-
- .macro blea
- .ifeq $NARG-1
- bca\0 4,1,\1
- .else
- bca\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro beqa
- .ifeq $NARG-1
- bca\0 12,2,\1
- .else
- bca\0 12,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bgea
- .ifeq $NARG-1
- bca\0 4,0,\1
- .else
- bca\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bgta
- .ifeq $NARG-1
- bca\0 12,1,\1
- .else
- bca\0 12,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bnla
- .ifeq $NARG-1
- bca\0 4,0,\1
- .else
- bca\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bnea
- .ifeq $NARG-1
- bca\0 4,2,\1
- .else
- bca\0 4,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bnga
- .ifeq $NARG-1
- bca\0 4,1,\1
- .else
- bca\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bsoa
- .ifeq $NARG-1
- bca\0 12,3,\1
- .else
- bca\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnsa
- .ifeq $NARG-1
- bca\0 4,3,\1
- .else
- bca\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro buna
- .ifeq $NARG-1
- bca\0 12,3,\1
- .else
- bca\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnua
- .ifeq $NARG-1
- bca\0 4,3,\1
- .else
- bca\0 4,4*(\1)+3,\2
- .endif
- .endm
-
-
- .macro bltlr
- .ifeq $NARG-1
- bclr\0 12,4*(\1)+0
- .else
- bclr\0 12,0
- .endif
- .endm
-
- .macro blelr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+1
- .else
- bclr\0 4,1
- .endif
- .endm
-
- .macro beqlr
- .ifeq $NARG-1
- bclr\0 12,4*(\1)+2
- .else
- bclr\0 12,2
- .endif
- .endm
-
- .macro bgelr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+0
- .else
- bclr\0 4,0
- .endif
- .endm
-
- .macro bgtlr
- .ifeq $NARG-1
- bclr\0 12,4*(\1)+1
- .else
- bclr\0 12,1
- .endif
- .endm
-
- .macro bnllr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+0
- .else
- bclr\0 4,0
- .endif
- .endm
-
- .macro bnelr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+2
- .else
- bclr\0 4,2
- .endif
- .endm
-
- .macro bnglr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+1
- .else
- bclr\0 4,1
- .endif
- .endm
-
- .macro bsolr
- .ifeq $NARG-1
- bclr\0 12,4*(\1)+3
- .else
- bclr\0 12,3
- .endif
- .endm
-
- .macro bnslr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+3
- .else
- bclr\0 4,3
- .endif
- .endm
-
- .macro bunlr
- .ifeq $NARG-1
- bclr\0 12,4*(\1)+3
- .else
- bclr\0 12,3
- .endif
- .endm
-
- .macro bnulr
- .ifeq $NARG-1
- bclr\0 4,4*(\1)+3
- .else
- bclr\0 4,3
- .endif
- .endm
-
- .macro bltctr
- .ifeq $NARG-1
- bcctr\0 12,4*(\1)+0
- .else
- bcctr\0 12,0
- .endif
- .endm
-
- .macro blectr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+1
- .else
- bcctr\0 4,1
- .endif
- .endm
-
- .macro beqctr
- .ifeq $NARG-1
- bcctr\0 12,4*(\1)+2
- .else
- bcctr\0 12,2
- .endif
- .endm
-
- .macro bgectr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+0
- .else
- bcctr\0 4,0
- .endif
- .endm
-
- .macro bgtctr
- .ifeq $NARG-1
- bcctr\0 12,4*(\1)+1
- .else
- bcctr\0 12,1
- .endif
- .endm
-
- .macro bnlctr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+0
- .else
- bcctr\0 4,0
- .endif
- .endm
-
- .macro bnectr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+2
- .else
- bcctr\0 4,2
- .endif
- .endm
-
- .macro bngctr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+1
- .else
- bcctr\0 4,1
- .endif
- .endm
-
- .macro bsoctr
- .ifeq $NARG-1
- bcctr\0 12,4*(\1)+3
- .else
- bcctr\0 12,3
- .endif
- .endm
-
- .macro bnsctr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+3
- .else
- bcctr\0 4,3
- .endif
- .endm
-
- .macro bunctr
- .ifeq $NARG-1
- bcctr\0 12,4*(\1)+3
- .else
- bcctr\0 12,3
- .endif
- .endm
-
- .macro bnuctr
- .ifeq $NARG-1
- bcctr\0 4,4*(\1)+3
- .else
- bcctr\0 4,3
- .endif
- .endm
-
-
- .macro bltl
- .ifeq $NARG-1
- bcl\0 12,0,\1
- .else
- bcl\0 12,4*(\1)+0,\2
- .endif
- .endm
-
- .macro blel
- .ifeq $NARG-1
- bcl\0 4,1,\1
- .else
- bcl\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro beql
- .ifeq $NARG-1
- bcl\0 12,2,\1
- .else
- bcl\0 12,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bgel
- .ifeq $NARG-1
- bcl\0 4,0,\1
- .else
- bcl\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bgtl
- .ifeq $NARG-1
- bcl\0 12,1,\1
- .else
- bcl\0 12,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bnll
- .ifeq $NARG-1
- bcl\0 4,0,\1
- .else
- bcl\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bnel
- .ifeq $NARG-1
- bcl\0 4,2,\1
- .else
- bcl\0 4,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bngl
- .ifeq $NARG-1
- bcl\0 4,1,\1
- .else
- bcl\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bsol
- .ifeq $NARG-1
- bcl\0 12,3,\1
- .else
- bcl\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnsl
- .ifeq $NARG-1
- bcl\0 4,3,\1
- .else
- bcl\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bunl
- .ifeq $NARG-1
- bcl\0 12,3,\1
- .else
- bcl\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnul
- .ifeq $NARG-1
- bcl\0 4,3,\1
- .else
- bcl\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bltla
- .ifeq $NARG-1
- bcla\0 12,0,\1
- .else
- bcla\0 12,4*(\1)+0,\2
- .endif
- .endm
-
- .macro blela
- .ifeq $NARG-1
- bcla\0 4,1,\1
- .else
- bcla\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro beqla
- .ifeq $NARG-1
- bcla\0 12,2,\1
- .else
- bcla\0 12,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bgela
- .ifeq $NARG-1
- bcla\0 4,0,\1
- .else
- bcla\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bgtla
- .ifeq $NARG-1
- bcla\0 12,1,\1
- .else
- bcla\0 12,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bnlla
- .ifeq $NARG-1
- bcla\0 4,0,\1
- .else
- bcla\0 4,4*(\1)+0,\2
- .endif
- .endm
-
- .macro bnela
- .ifeq $NARG-1
- bcla\0 4,2,\1
- .else
- bcla\0 4,4*(\1)+2,\2
- .endif
- .endm
-
- .macro bngla
- .ifeq $NARG-1
- bcla\0 4,1,\1
- .else
- bcla\0 4,4*(\1)+1,\2
- .endif
- .endm
-
- .macro bsola
- .ifeq $NARG-1
- bcla\0 12,3,\1
- .else
- bcla\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnsla
- .ifeq $NARG-1
- bcla\0 4,3,\1
- .else
- bcla\0 4,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bunla
- .ifeq $NARG-1
- bcla\0 12,3,\1
- .else
- bcla\0 12,4*(\1)+3,\2
- .endif
- .endm
-
- .macro bnula
- .ifeq $NARG-1
- bcla\0 4,3,\1
- .else
- bcla\0 4,4*(\1)+3,\2
- .endif
- .endm
-
-
- .macro bltlrl
- .ifeq $NARG-1
- bclrl\0 12,4*(\1)+0
- .else
- bclrl\0 12,0
- .endif
- .endm
-
- .macro blelrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+1
- .else
- bclrl\0 4,1
- .endif
- .endm
-
- .macro beqlrl
- .ifeq $NARG-1
- bclrl\0 12,4*(\1)+2
- .else
- bclrl\0 12,2
- .endif
- .endm
-
- .macro bgelrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+0
- .else
- bclrl\0 4,0
- .endif
- .endm
-
- .macro bgtlrl
- .ifeq $NARG-1
- bclrl\0 12,4*(\1)+1
- .else
- bclrl\0 12,1
- .endif
- .endm
-
- .macro bnllrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+0
- .else
- bclrl\0 4,0
- .endif
- .endm
-
- .macro bnelrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+2
- .else
- bclrl\0 4,2
- .endif
- .endm
-
- .macro bnglrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+1
- .else
- bclrl\0 4,1
- .endif
- .endm
-
- .macro bsolrl
- .ifeq $NARG-1
- bclrl\0 12,4*(\1)+3
- .else
- bclrl\0 12,3
- .endif
- .endm
-
- .macro bnslrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+3
- .else
- bclrl\0 4,3
- .endif
- .endm
-
- .macro bunlrl
- .ifeq $NARG-1
- bclrl\0 12,4*(\1)+3
- .else
- bclrl\0 12,3
- .endif
- .endm
-
- .macro bnulrl
- .ifeq $NARG-1
- bclrl\0 4,4*(\1)+3
- .else
- bclrl\0 4,3
- .endif
- .endm
-
- .macro bltctrl
- .ifeq $NARG-1
- bcctrl\0 12,4*(\1)+0
- .else
- bcctrl\0 12,0
- .endif
- .endm
-
- .macro blectrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+1
- .else
- bcctrl\0 4,1
- .endif
- .endm
-
- .macro beqctrl
- .ifeq $NARG-1
- bcctrl\0 12,4*(\1)+2
- .else
- bcctrl\0 12,2
- .endif
- .endm
-
- .macro bgectrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+0
- .else
- bcctrl\0 4,0
- .endif
- .endm
-
- .macro bgtctrl
- .ifeq $NARG-1
- bcctrl\0 12,4*(\1)+1
- .else
- bcctrl\0 12,1
- .endif
- .endm
-
- .macro bnlctrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+0
- .else
- bcctrl\0 4,0
- .endif
- .endm
-
- .macro bnectrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+2
- .else
- bcctrl\0 4,2
- .endif
- .endm
-
- .macro bngctrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+1
- .else
- bcctrl\0 4,1
- .endif
- .endm
-
- .macro bsoctrl
- .ifeq $NARG-1
- bcctrl\0 12,4*(\1)+3
- .else
- bcctrl\0 12,3
- .endif
- .endm
-
- .macro bnsctrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+3
- .else
- bcctrl\0 4,3
- .endif
- .endm
-
- .macro bunctrl
- .ifeq $NARG-1
- bcctrl\0 12,4*(\1)+3
- .else
- bcctrl\0 12,3
- .endif
- .endm
-
- .macro bnuctrl
- .ifeq $NARG-1
- bcctrl\0 4,4*(\1)+3
- .else
- bcctrl\0 4,3
- .endif
- .endm
-
-
- .macro crset
- creqv \1,\1,\1
- .endm
-
- .macro crclr
- crxor \1,\1,\1
- .endm
-
- .macro crmove
- cror \1,\2,\2
- .endm
-
- .macro crnot
- crnor \1,\2,\2
- .endm
-
-
- .macro trap
- tw 31,0,0
- .endm
-
- .macro twlt
- tw 16,\1,\2
- .endm
-
- .macro twle
- tw 20,\1,\2
- .endm
-
- .macro tweq
- tw 4,\1,\2
- .endm
-
- .macro twge
- tw 12,\1,\2
- .endm
-
- .macro twgt
- tw 8,\1,\2
- .endm
-
- .macro twnl
- tw 12,\1,\2
- .endm
-
- .macro twne
- tw 24,\1,\2
- .endm
-
- .macro twng
- tw 20,\1,\2
- .endm
-
- .macro twllt
- tw 2,\1,\2
- .endm
-
- .macro twlle
- tw 6,\1,\2
- .endm
-
- .macro twlge
- tw 5,\1,\2
- .endm
-
- .macro twlgt
- tw 1,\1,\2
- .endm
-
- .macro twlnl
- tw 5,\1,\2
- .endm
-
- .macro twlng
- tw 6,\1,\2
- .endm
-
- .macro twlti
- twi 16,\1,\2
- .endm
-
- .macro twlei
- twi 20,\1,\2
- .endm
-
- .macro tweqi
- twi 4,\1,\2
- .endm
-
- .macro twgei
- twi 12,\1,\2
- .endm
-
- .macro twgti
- twi 8,\1,\2
- .endm
-
- .macro twnli
- twi 12,\1,\2
- .endm
-
- .macro twnei
- twi 24,\1,\2
- .endm
-
- .macro twngi
- twi 20,\1,\2
- .endm
-
- .macro twllti
- twi 2,\1,\2
- .endm
-
- .macro twllei
- twi 6,\1,\2
- .endm
-
- .macro twlgei
- twi 5,\1,\2
- .endm
-
- .macro twlgti
- twi 1,\1,\2
- .endm
-
- .macro twlnli
- twi 5,\1,\2
- .endm
-
- .macro twlngi
- twi 6,\1,\2
- .endm
-
- .macro tdlt
- td 16,\1,\2
- .endm
-
- .macro tdle
- td 20,\1,\2
- .endm
-
- .macro tdeq
- td 4,\1,\2
- .endm
-
- .macro tdge
- td 12,\1,\2
- .endm
-
- .macro tdgt
- td 8,\1,\2
- .endm
-
- .macro tdnl
- td 12,\1,\2
- .endm
-
- .macro tdne
- td 24,\1,\2
- .endm
-
- .macro tdng
- td 20,\1,\2
- .endm
-
- .macro tdllt
- td 2,\1,\2
- .endm
-
- .macro tdlle
- td 6,\1,\2
- .endm
-
- .macro tdlge
- td 5,\1,\2
- .endm
-
- .macro tdlgt
- td 1,\1,\2
- .endm
-
- .macro tdlnl
- td 5,\1,\2
- .endm
-
- .macro tdlng
- td 6,\1,\2
- .endm
-
- .macro tdlti
- tdi 16,\1,\2
- .endm
-
- .macro tdlei
- tdi 20,\1,\2
- .endm
-
- .macro tdeqi
- tdi 4,\1,\2
- .endm
-
- .macro tdgei
- tdi 12,\1,\2
- .endm
-
- .macro tdgti
- tdi 8,\1,\2
- .endm
-
- .macro tdnli
- tdi 12,\1,\2
- .endm
-
- .macro tdnei
- tdi 24,\1,\2
- .endm
-
- .macro tdngi
- tdi 20,\1,\2
- .endm
-
- .macro tdllti
- tdi 2,\1,\2
- .endm
-
- .macro tdllei
- tdi 6,\1,\2
- .endm
-
- .macro tdlgei
- tdi 5,\1,\2
- .endm
-
- .macro tdlgti
- tdi 1,\1,\2
- .endm
-
- .macro tdlnli
- tdi 5,\1,\2
- .endm
-
- .macro tdlngi
- tdi 6,\1,\2
- .endm
-
-
- .macro mtxer
- mtspr 1,\1
- .endm
-
- .macro mtlr
- mtspr 8,\1
- .endm
-
- .macro mtctr
- mtspr 9,\1
- .endm
-
- .macro mtdsisr
- mtspr 18,\1
- .endm
-
- .macro mtdar
- mtspr 19,\1
- .endm
-
- .macro mtdec
- mtspr 22,\1
- .endm
-
- .macro mtsdr1
- mtspr 25,\1
- .endm
-
- .macro mtsrr0
- mtspr 26,\1
- .endm
-
- .macro mtsrr1
- mtspr 27,\1
- .endm
-
- .macro mtsprg
- mtspr 272+(\1),\2
- .endm
-
- .macro mtasr
- mtspr 280,\1
- .endm
-
- .macro mtear
- mtspr 282,\1
- .endm
-
- .macro mttbl
- mtspr 284,\1
- .endm
-
- .macro mttbu
- mtspr 285,\1
- .endm
-
- .macro mtibatu
- mtspr 528+2*(\1),\2
- .endm
-
- .macro mtibatl
- mtspr 529+2*(\1),\2
- .endm
-
- .macro mtdbatu
- mtspr 536+2*(\1),\2
- .endm
-
- .macro mtdbatl
- mtspr 537+2*(\1),\2
- .endm
-
- .macro mtdabr
- mtspr 1013,\1
- .endm
-
- .macro mfxer
- mfspr \1,1
- .endm
-
- .macro mflr
- mfspr \1,8
- .endm
-
- .macro mfctr
- mfspr \1,9
- .endm
-
- .macro mfdsisr
- mfspr \1,18
- .endm
-
- .macro mfdar
- mfspr \1,19
- .endm
-
- .macro mfdec
- mfspr 22,\1
- .endm
-
- .macro mfsdr1
- mfspr \1,25
- .endm
-
- .macro mfsrr0
- mfspr \1,26
- .endm
-
- .macro mfsrr1
- mfspr \1,27
- .endm
-
- .macro mfsprg
- mfspr \1,272+(\2)
- .endm
-
- .macro mfasr
- mfspr \1,280
- .endm
-
- .macro mfear
- mfspr \1,282
- .endm
-
- .macro mftbl
- mftb \1,268
- .endm
-
- .macro mftbu
- mftb \1,269
- .endm
-
- .macro mfpvr
- mfspr \1,287
- .endm
-
- .macro mfibatu
- mfspr \1,528+2*(\2)
- .endm
-
- .macro mfibatl
- mfspr \1,529+2*(\2)
- .endm
-
- .macro mfdbatu
- mfspr \1,536+2*(\2)
- .endm
-
- .macro mfdbatl
- mfspr \1,537+2*(\2)
- .endm
-
- .macro mfdabr
- mfspr \1,1013
- .endm
-
-
- .macro nop
- ori 0,0,0
- .endm
-
- .macro li
- addi \1,0,\2
- .endm
-
- .macro lis
- addis \1,0,\2
- .endm
-
- .macro mr
- or \1,\2,\2
- .endm
-
- .macro mr.
- or. \1,\2,\2
- .endm
-
- .macro not
- nor \1,\2,\2
- .endm
-
- .macro not.
- nor. \1,\2,\2
- .endm
-
- .macro mtcr
- mtcrf 0xff,\1
- .endm
-
-